<?php
declare (strict_types = 1);

namespace app\common\basic\controller;



use app\common\basic;
use app\common\basic\App;
use kernel;

/**
 * 控制器基础类
 */
abstract class BaseController
{
    /**
     * Request实例
     * @var \bear\Request
     */
    protected $request;

    /**
     * 应用实例
     * @var \bear\Bear
     */
    protected $app;

    /**
     * 控制器中间件
     * @var array
     */
    protected $middleware = [];

    /**
     * 逻辑实例
     * @var
     */
    protected $logic;


    /**
     * 构造方法
     * @access public
     * @param App $app 应用对象
     */
    public function __construct()
    {
        $this->app =  \kernel\App::getInstance("app");;
        //$this->request = app('request');
        $this->initialize();
    }

    /**
     * @return mixed
     */
    abstract protected function initialize();
}
